<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <body>

        <ui:composition template="./template.xhtml">

            <ui:define name="title">
                Event Page
            </ui:define>

            <ui:define name="content">
                <h:form>
               <p:panelGrid columns="2">
                    <f:facet name="header">
                        Change Password
                    </f:facet>

                    <h:outputLabel for="oldPass" value="Old Password:*" />
                    <h:inputSecret value="#{userController.oldPass}" id="oldPass" title="Old Password"
                                   styleClass="ui-inputfield ui-inputtext ui-widget ui-state-default ui-corner-all"
                                   required="true" requiredMessage="Old Password field cannot blank"/>
                    <h:outputLabel for="newPass" value="New Password:*" />
                    <p:password id="newPass" value="#{userController.newPass}"
                                required="true" requiredMessage="New Password field cannot blank" feedback="true"
                                match="newPassConfirm" validatorMessage="password confirm sam as password"/>
                    <h:outputLabel for="newPassConfirm" value="Confirm New Password:*" />
                    <p:password id="newPassConfirm" value="#{userController.newPassConfirm}"
                                required="true" requiredMessage="Confirm New Password field cannot blank"
                                />
                    <f:facet name="footer">
                        <p:commandButton ajax="false" action="#{userController.changePassword}" value="Save" />
                        <p:commandButton ajax="false" value="Cancel" action="home" immediate="true"/>
                    </f:facet>
                </p:panelGrid>
                </h:form>

            </ui:define>

        </ui:composition>

    </body>
</html>
